﻿@using CafeOnline.Localization

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    var currentController = ViewContext.RouteData.Values["Controller"];
    var currentAction = ViewContext.RouteData.Values["Action"];
}

@section ScriptHeader{

    <script type="text/javascript">
        $(document).ready(function () {
            $('#btnCreate').ajaxHandler({
                viewSuccess: 'searchDiv',
                viewError: 'error-container',
                viewLoading: 'loading-spinner',
                beforeSend: function () {
                    $('#divDetail').hide();
                    $('#actionDiv').hide();
                },
                onError: function () {
                    $('#searchDiv').show();
                },
                onSuccess: function () {

                }
            });
            //$('#btnSave').ajaxHandler({
            //    viewSuccess: 'searchDiv',
            //    viewError: 'error-container',
            //    viewLoading: 'loading-spinner',
            //    ajaxType: 'JSON',
            //    ajaxData: $('#createForm').serialize(),
            //    beforeSend: function () {

            //    },
            //    onError: function () {
            //        $('#searchDiv').show();
            //    },
            //    onSuccess: function () {
            //        $('#searchDiv').show();
            //    }
            //});
        });
    </script>
}
<div class="heading">
    <h3>@ViewBag.Title</h3>

    <div class="resBtnSearch">
        <a href="#"><span class="icon16 icomoon-icon-search-3"></span></a>
    </div>

    <div class="search">

        <form id="searchform" action="search.html">
            <input type="text" id="tipue_search_input" class="top-search" placeholder="Search here ..." />
            <input type="submit" id="tipue_search_button" class="search-btn" value="" />
        </form>

    </div>
    <!-- End search -->

    <ul class="breadcrumb">
        <li>You are here:</li>
        <li>
            <a href="#" class="tip" title="back to dashboard">
                <span class="icon16 icomoon-icon-screen-2"></span>
            </a>
            <span class="divider">
                <span class="icon16 icomoon-icon-arrow-right-2"></span>
            </span>
        </li>
        <li class="active">@currentController<span class="icon16 icomoon-icon-arrow-right-2"></span>@currentAction</li>
    </ul>

</div>

<!--- End Heading--->

<div class="row-fluid">
    <div class="span12" id="actionDiv">
        <div class="well well-small">
            <ul class="bigBtnIcon text-align-left">
                @if (ViewBag.CanCreate) {
                    <li>
                        <a id="btnCreate" href="@Url.Action("Create", currentController)">
                            <span class="icon icomoon-icon-file-add"></span>
                            <span class="txt">@Resources.Create</span>
                        </a>
                    </li>
                }
            </ul>
        </div>
    </div>

    <div id="searchDiv">
    </div>
    <div id="divDetail">
        @RenderBody()
    </div>
</div>


